package com.ht.temp.controller;


import com.ht.temp.entity.MinReport;
import com.ht.temp.service.IMinReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mayke_zhou
 * @since 2018-12-24
 */
@RestController
@RequestMapping("/min-report")
public class MinReportController {
    @Autowired
    private IMinReportService iMinReportService;


    @RequestMapping(value = "getMinReportByHoursAvg",method = RequestMethod.GET)
    public MinReport getMinReportByHoursAvg(Integer deviceId,String startTime,String endTime){
        System.out.println(deviceId);
        MinReport minReport = iMinReportService.getMinReportByHoursAvg(deviceId);
        System.out.println(minReport.toString());
        return minReport ;
    }



    @RequestMapping(value = "getMinReportByHours",method = RequestMethod.POST)
    public List<MinReport> getMinReportByHours(Integer deviceId, String startTime, String endTime){
        System.out.println(deviceId);

       // System.out.println(minReport.toString());
        return iMinReportService.getMinReportByHours(deviceId,startTime,endTime);
    }
}
